<template>
  <div class="page log-detail-page">
    <nav-bar title="工作日志"></nav-bar>
    <div class="page-main" style="margin-top: 44px">
      <div class="log-detail-date">
        <p>{{ formParams.logDateName }} {{ formParams.weekday }}</p>
      </div>
      <van-form input-align="right" :label-width="120">
        <van-field
          readonly
          required
          v-model="formParams.reportEventNum"
          label="上报事件数"
          label-class="van-cell__title_gray"
        >
          <template v-slot:right-icon>
            <span>件</span>
          </template>
        </van-field>
        <van-field
          readonly
          required
          v-model="formParams.finishEventNum"
          label="办结事件数"
          label-class="van-cell__title_gray"
        >
          <template v-slot:right-icon>
            <span>件</span>
          </template>
        </van-field>
        <van-field
          readonly
          required
          label="基础信息审核数"
          v-model="formParams.biApproveNum"
          label-class="van-cell__title_gray"
        >
          <template v-slot:right-icon>
            <span>件</span>
          </template>
        </van-field>
        <van-field
          required
          readonly
          label="基础信息采集数"
          v-model="formParams.biSubmitNum"
          label-class="van-cell__title_gray"
          :border="false"
        >
          <template v-slot:right-icon>
            <span>件</span>
          </template>
        </van-field>
        <div class="log-detail-con">
          <van-field
            readonly
            v-model="formParams.logContent"
            rows="12"
            autosize
            type="textarea"
            :border="false"
            input-align="left"
            class="van-field__value--textarea-lightgray"
          />
        </div>
        <div style="padding: 60px 16px">
          <van-button
            block
            type="info"
            native-type="button"
            @click="$router.push(`/routine/log/report?logCode=${formParams.logCode}&logDate=${formParams.logDate}`)"
          >
            编辑
          </van-button>
        </div>
      </van-form>
    </div>
  </div>
</template>
<script>
import Routine from '@/api/routine'
export default {
  data() {
    return {
      formParams: {}
    }
  },
  created() {
    this.getDetail()
  },
  methods: {
    getDetail() {
      Routine.Log.detail({
        logCode: this.$route.query.logCode
      }).then(res => {
        const { status } = res.data
        if (status === 0) {
          this.formParams = res.data.data
        }
      })
    }
  }
}
</script>
<style lang="less" scoped>
@import '~@/assets/style/routine/log/detail.less';
</style>
